package com.example.x6.configurationmaintenance.Dialog;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.util.Log;
import com.example.x6.configurationmaintenance.R;
import com.example.x6.configurationmaintenance.Utils.RebootUtil;

public class PowerOffDialog {
    private final String TAG = getClass().getSimpleName();
    private Context context;

    public PowerOffDialog(Context context2) {
        this.context = context2;
    }

    public void showDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this.context);
        builder.setTitle(this.context.getResources().getString(R.string.tips));
        builder.setMessage(this.context.getResources().getString(R.string.reboot_tips));
        builder.setPositiveButton(this.context.getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
            /* class com.example.x6.configurationmaintenance.Dialog.PowerOffDialog.AnonymousClass1 */

            public void onClick(DialogInterface dialogInterface, int i) {
                RebootUtil.reboot(PowerOffDialog.this.context);
            }
        });
        builder.setNegativeButton(this.context.getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
            /* class com.example.x6.configurationmaintenance.Dialog.PowerOffDialog.AnonymousClass2 */

            public void onClick(DialogInterface dialogInterface, int i) {
                Log.w(PowerOffDialog.this.TAG, "取消重启");
            }
        });
        builder.show();
    }
}
